-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(instrumentation): allow different export types for files within a Node module #4046
fix(instrumentation): allow different export types for files within a Node module #4046
Conversation
16864d4
to
c2cdd98
Compare
c2cdd98
to
a3e55f7
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4046 +/- ##
==========================================
- Coverage 92.83% 92.23% -0.61%
==========================================
Files 328 334 +6
Lines 9519 9463 -56
Branches 2050 2009 -41
==========================================
- Hits 8837 8728 -109
- Misses 682 735 +53
|
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
a3e55f7
to
9796bb1
Compare
9796bb1
to
d2e415d
Compare
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
d2e415d
to
41fb74f
Compare
@pichlermarc could you please take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see this being useful. Pinging @dyladan as I seem to remember we talked about this at some point - he might have some input on the matter.
@@ -22,7 +22,7 @@ import { | |||
export class InstrumentationNodeModuleDefinition<T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dyladan I seem to remember that we discussed changing this to <T=any>
at some point so that it can be left out for reasons like this. WDYT?
41fb74f
to
da28a0a
Compare
… Node module Signed-off-by: Andrew Haines <andrew@haines.org.nz>
da28a0a
to
030c97e
Compare
Hi @pichlermarc @dyladan, is there anything blocking getting this merged? |
Which problem is this PR solving?
The
InstrumentationModuleDefinition<T>
interface defines a propertyfiles: InstrumentationModuleFile<any>[]
.InstrumentationNodeModuleDefinition<T>
implements this interface but defines the property asfiles: InstrumentationModuleFile<T>[]
. This implies that all files within the module have the same exports type, which is unlikely! As a result, you cannot (for example) call.push()
on the files field without type casting.Short description of the changes
This PR changes the type of the property in the class to match the interface it implements.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
npm run compile
Checklist:
Unit tests have been addedDocumentation has been updated